import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { OldageRoutingModule } from './oldage-routing.module';
import { OldageCheckComponent } from './check/check.component';
import { OldageDetailComponent } from './detail/detail.component';
import { OldageEditComponent } from './edit/edit.component';
import { EnclosureComponent } from './enclosure/enclosure.component';
import { CostComponent } from './modal/cost/cost.component';
import { BankrollComponent } from './modal/bankroll/bankroll.component';
import { CheckComponent } from './modal/check/check.component';
import { ServiceComponent } from './modal/service/service.component';
import { InvestComponent } from './modal/invest/invest.component';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import * as flatpickr from 'flatpickr';
import { FlatpickrModule, FLATPICKR } from '../../../assets/angularx-flatpickr';
import { AppPaginationModule } from '../../widgets/pagination/pagination.module';
import { AreaDataCnModule } from "../../widgets/area-data-cn/area-data-cn.module";
import { CustomFormsModule } from 'ng2-validation';
import { OldageInfoComponent } from '../oldage/modal/info/info.component';
import { RenewComponent } from './modal/renew/renew.component';
import { ScaleComponent } from './modal/scale/scale.component';
export function flatpickrFactory() {
  return flatpickr;
}

@NgModule({
  imports: [
    CommonModule,
    OldageRoutingModule,
    AppPaginationModule,
    FormsModule,
    CustomFormsModule,
    AreaDataCnModule,
    FlatpickrModule.forRoot({
      provide: FLATPICKR,
      useFactory: flatpickrFactory
    })
  ],
  declarations: [
    OldageCheckComponent,
    OldageDetailComponent,
    OldageEditComponent,
    EnclosureComponent,
    CostComponent,
    BankrollComponent,
    CheckComponent,
    ServiceComponent,
    InvestComponent,
    OldageInfoComponent,
    RenewComponent,
    ScaleComponent
  ],
  entryComponents: [
    CostComponent,
    BankrollComponent,
    CheckComponent,
    ServiceComponent,
    InvestComponent,
    OldageInfoComponent,
    RenewComponent,
    ScaleComponent
  ]
})
export class OldageModule { }
